using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using AutoGear.BLL;
using ECommerce.Library.Web;
using ECommerce.Library;
using eShop.Model;
using eShop.Business;

public partial class controls_wucProductBrand : BaseControl
{
    private string _brandId = string.Empty;
    public string BrandId
    {
        get { return this._brandId; }
        set { this._brandId = value; }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadData();
        }
    }

    private void LoadData()
    {
        if (!string.IsNullOrEmpty(BrandId))
        {
            int id = 0;
            if (int.TryParse(BrandId, out id))
            {
                if (id > 0)
                {
                    Manufacturer brand = ManufacturerManager.GetById(id);
                    if (brand != null)
                    {
                        lblSitePathBrandName.Text = brand.BrandName;
                        ltlBrandNameTitle.Text = brand.BrandName.ToUpper();
                        ltlBrandNameCatalogTitle.Text = brand.BrandName.ToUpper();
                        imgBrandLogo.ImageUrl =ImageResizer.CheckImageMissing(brand.BrandImageUrl, SiteSettings.NoImageUrl);
                        imgBrandLogo.AlternateText = brand.BrandName;
                        //hlkCalalogButton.NavigateUrl = brand.BrandCatalogFileUrl;
                        ltlBrandDescription.Text = Server.HtmlDecode(brand.BrandDescription);
                        
                        wucBrandProducts.PageSize = SiteUtility.GridDefaultPageSize;
                        wucBrandProducts.MaxItem = 3;
                        wucBrandProducts.RepeatedColumns = 3;
                        wucBrandProducts.ProductBrandId = id;
                    }
                }
            }
        }
       

    }
}
